clear classes

Exp = ET_PTB_SIMPLE();

% Resolution
%--------------------------------------------------------------------------
Exp.scn.res = 6;

% Screen size
%--------------------------------------------------------------------------
Exp.scn.w = 1680;
Exp.scn.h = 1050;
Exp.scn.wcm  = 47.7;
Exp.scn.hcb = 29.8;
Exp.scn.dist = 78;
Exp.scn.mon = 0;
% Amplitud in screen units
%--------------------------------------------------------------------------
Exp.fix.x = -.75;

% Speed in degrees per second when the stimulus crosses the center
%--------------------------------------------------------------------------
% The number of trials should be divisible by the number of speeds.
v              = [18,22];
speeds         = (360./v) * ((Exp.scn.wcm/2)*abs(Exp.fix.x)*Exp.refresh_rate)/Exp.view_dist;
Exp.FpClearn   = speeds;

% Number of trials befor a pause
%--------------------------------------------------------------------------
Exp.pauses = 8;

% Size of stimuli
%--------------------------------------------------------------------------
Exp.stim.size = 10;

% Prepare experiment
%--------------------------------------------------------------------------
Exp.prepareBlocks(3);
Exp.prepareTrials(8);

Exp.prepareFixation();

% Size and position of the occluder.
%--------------------------------------------------------------------------
Exp.prepareOccluder(Exp.scn.w*abs(Exp.fix.x)*(2/5),-Exp.scn.w*abs(Exp.fix.x)*(1/5));
Exp.prepareSpeeds()
Exp.prepareJump()

% Define stimuli trayectory
%--------------------------------------------------------------------------
clear randomSinusWalk

seed = round(rand * 1e+6);


% Random stimuli
s    = exp(-0.5);                     % Standard deviation
% Exp.stimuli = inline(sprintf('randomSinusWalk(x,f,%0.2f,%i)',s,seed),'x','f');

% Random stimuli WITH SAME NOISE IN EACH TRIAL
% Exp.stimuli = inline(sprintf('randomSinusWalk(x,f,%0.2f,%i)',s,23942302),'x','f');

% Random stimuli with GAUSSIAN NOISE
% Exp.stimuli = inline(sprintf('normalizedNoise(x,f,%0.2f,%i)',s,seed),'x','f');

% Non-random stimuli
Exp.stimuli = inline('cos(x*2*pi)','x','f');

% Turn eye link on
%--------------------------------------------------------------------------
Exp.EyeLink = 1;

try 
    Exp.runScreen()
catch Err
    Exp.exit(Err)
end
    
